<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Luadocs for table_ext.lua</title>
    <link rel="stylesheet" href="../luadoc.css" type="text/css" />
	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>

<body>
<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->

<div id="main">

<div id="navigation">


<h1>LuaDoc</h1>
<ul>
	
	<li><a href="../index.html">Index</a></li>
	
</ul>


<!-- Module list -->

<h1>Modules</h1>
<ul>

	<li>
		<a href="../modules/base.html">base</a>
	</li>

	<li>
		<a href="../modules/bin.html">bin</a>
	</li>

	<li>
		<a href="../modules/debug.html">debug</a>
	</li>

	<li>
		<a href="../modules/fstable.html">fstable</a>
	</li>

	<li>
		<a href="../modules/getopt.html">getopt</a>
	</li>

	<li>
		<a href="../modules/io.html">io</a>
	</li>

	<li>
		<a href="../modules/lcs.html">lcs</a>
	</li>

	<li>
		<a href="../modules/list.html">list</a>
	</li>

	<li>
		<a href="../modules/math.html">math</a>
	</li>

	<li>
		<a href="../modules/mbox.html">mbox</a>
	</li>

	<li>
		<a href="../modules/object.html">object</a>
	</li>

	<li>
		<a href="../modules/package.html">package</a>
	</li>

	<li>
		<a href="../modules/parser.html">parser</a>
	</li>

	<li>
		<a href="../modules/set.html">set</a>
	</li>

	<li>
		<a href="../modules/std.html">std</a>
	</li>

	<li>
		<a href="../modules/strbuf.html">strbuf</a>
	</li>

	<li>
		<a href="../modules/string.html">string</a>
	</li>

	<li>
		<a href="../modules/table.html">table</a>
	</li>

	<li>
		<a href="../modules/tree.html">tree</a>
	</li>

</ul>



<!-- File list -->

<h1>Files</h1>
<ul>

	<li>
		<a href="../files/base.html">base.lua</a>
	</li>

	<li>
		<a href="../files/bin.html">bin.lua</a>
	</li>

	<li>
		<a href="../files/debug_ext.html">debug_ext.lua</a>
	</li>

	<li>
		<a href="../files/debug_init.html">debug_init.lua</a>
	</li>

	<li>
		<a href="../files/fstable.html">fstable.lua</a>
	</li>

	<li>
		<a href="../files/getopt.html">getopt.lua</a>
	</li>

	<li>
		<a href="../files/io_ext.html">io_ext.lua</a>
	</li>

	<li>
		<a href="../files/lcs.html">lcs.lua</a>
	</li>

	<li>
		<a href="../files/list.html">list.lua</a>
	</li>

	<li>
		<a href="../files/math_ext.html">math_ext.lua</a>
	</li>

	<li>
		<a href="../files/mbox.html">mbox.lua</a>
	</li>

	<li>
		<a href="../files/modules.html">modules.lua</a>
	</li>

	<li>
		<a href="../files/object.html">object.lua</a>
	</li>

	<li>
		<a href="../files/package_ext.html">package_ext.lua</a>
	</li>

	<li>
		<a href="../files/parser.html">parser.lua</a>
	</li>

	<li>
		<a href="../files/set.html">set.lua</a>
	</li>

	<li>
		<a href="../files/std.html">std.lua</a>
	</li>

	<li>
		<a href="../files/strbuf.html">strbuf.lua</a>
	</li>

	<li>
		<a href="../files/strict.html">strict.lua</a>
	</li>

	<li>
		<a href="../files/string_ext.html">string_ext.lua</a>
	</li>

	<li><strong>table_ext.lua</strong></li>
	
	<li>
		<a href="../files/tree.html">tree.lua</a>
	</li>

	<li>
		<a href="../files/xml.html">xml.lua</a>
	</li>

</ul>






</div> <!-- id="navigation" -->

<div id="content">

<h1>File <code>table_ext.lua</code></h1>


<p>Make table.sort return its result.</p>






<h2>Functions</h2>
<table class="function_list">

	<tr>
	<td class="name" nowrap><a href="#clone">clone</a>&nbsp;(t, nometa)</td>
	<td class="summary">Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#empty">empty</a>&nbsp;(t)</td>
	<td class="summary">Return whether table is empty.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#indices">indices</a>&nbsp;(t)</td>
	<td class="summary">Make the list of indices of a table.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#invert">invert</a>&nbsp;(t)</td>
	<td class="summary">Invert a table.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#merge">merge</a>&nbsp;(t, u)</td>
	<td class="summary">Merge two tables.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#new">new</a>&nbsp;(x, t)</td>
	<td class="summary">Make a table with a default value for unset keys.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#rearrange">rearrange</a>&nbsp;(m, t)</td>
	<td class="summary">Rearrange some indices of a table.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#size">size</a>&nbsp;(t)</td>
	<td class="summary">Find the number of elements in a table.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#sort">sort</a>&nbsp;(t, c)</td>
	<td class="summary">Make table.sort return its result.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#values">values</a>&nbsp;(t)</td>
	<td class="summary">Make the list of values of a table.</td>
	</tr>

</table>






<br/>
<br/>




<h2><a name="functions"></a>Functions</h2>
<dl class="function">



<dt><a name="clone"></a><strong>clone</strong>&nbsp;(t, nometa)</dt>
<dd>
Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
	<li>
	  nometa: if non-nil don't copy metatable
	</li>
	
</ul>






<h3>Return value:</h3>
copy of table



</dd>




<dt><a name="empty"></a><strong>empty</strong>&nbsp;(t)</dt>
<dd>
Return whether table is empty.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
</ul>






<h3>Return value:</h3>
<code>true</code> if empty or <code>false</code> otherwise



</dd>




<dt><a name="indices"></a><strong>indices</strong>&nbsp;(t)</dt>
<dd>
Make the list of indices of a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
</ul>






<h3>Return value:</h3>
list of indices



</dd>




<dt><a name="invert"></a><strong>invert</strong>&nbsp;(t)</dt>
<dd>
Invert a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table <code>{i=v, ...}</code>
	</li>
	
</ul>






<h3>Return value:</h3>
inverted table <code>{v=i, ...}</code>



</dd>




<dt><a name="merge"></a><strong>merge</strong>&nbsp;(t, u)</dt>
<dd>
Merge two tables. If there are duplicate fields, u's will be used. The metatable of the returned table is that of t.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: first table
	</li>
	
	<li>
	  u: second table
	</li>
	
</ul>






<h3>Return value:</h3>
merged table



</dd>




<dt><a name="new"></a><strong>new</strong>&nbsp;(x, t)</dt>
<dd>
Make a table with a default value for unset keys.


<h3>Parameters</h3>
<ul>
	
	<li>
	  x: default entry value (default: <code>nil</code>)
	</li>
	
	<li>
	  t: initial table (default: <code>{}</code>)
	</li>
	
</ul>






<h3>Return value:</h3>
table whose unset elements are x



</dd>




<dt><a name="rearrange"></a><strong>rearrange</strong>&nbsp;(m, t)</dt>
<dd>
Rearrange some indices of a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  m: table <code>{old_index=new_index, ...}</code>
	</li>
	
	<li>
	  t: table to rearrange
	</li>
	
</ul>






<h3>Return value:</h3>
rearranged table



</dd>




<dt><a name="size"></a><strong>size</strong>&nbsp;(t)</dt>
<dd>
Find the number of elements in a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
</ul>






<h3>Return value:</h3>
number of elements in t



</dd>




<dt><a name="sort"></a><strong>sort</strong>&nbsp;(t, c)</dt>
<dd>
Make table.sort return its result.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
	<li>
	  c: comparator function
	</li>
	
</ul>






<h3>Return value:</h3>
sorted table



</dd>




<dt><a name="values"></a><strong>values</strong>&nbsp;(t)</dt>
<dd>
Make the list of values of a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  t: table
	</li>
	
</ul>






<h3>Return value:</h3>
list of values



</dd>


</dl>







</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->
</body>
</html>
